 <!-- Table (TABLE) -->
 <div >
      <h3 class="tit">User Information</h3>
      <table>
        <tr>
          <th width="200" style="width:200px;">UserName</th>
          <th width="200" style="width:200px;">Grade</th>          
		  <th width="200" style="width:200px;">Department</th>
		  <th width="198" style="width:150px;">Position</th>
		  <th width="202" style="width:200px;">Email</th>
          
          <?php 
				$tmpCI = &get_instance();
				if($tmpCI->session->userdata("usertype")== 4){
			?>
          <th width="80" style="width:80px;">Edit</th>
          <th width="80" style="width:80px;">Del</th>
          <?php }?>
        </tr>
<?php 
		$i = 0;
		if (isset($list))
		{
        foreach ($list->result_array() as $row)
		{
			?>
		 <tr <?php if ($i%2 == 1)echo 'class="bg"';?>>
			<td>
			<?php 
			echo '<a href="'.base_url("index.php/user/detail/".$row["uid"]).'">'.($row["name"]==""?"no name":$row["name"])."</a>";
			?>			</td>
			<td>
			<?php 
			echo $row["type"];
			?>			</td>
			<td>
			 <?php $de=array(1=>"Department1",2=>"Department2",3=>"Department3",4=>"Department4")?>
			<?php 
			echo $de[$row["person"]];
			?>			</td>
			<td>
			<?php 
			echo $row["post"];
			?>			</td>
			<td>
			<?php 
			echo $row["email"];
			?>			</td>
			<?php 
				$tmpCI = &get_instance();
				if($tmpCI->session->userdata("usertype")== 4){
			?>
			
			
			<td>
			<?php 
			echo '<a href="'.base_url("index.php/user/edit/".$row["uid"]).'">Edit</a>';
			?>			</td>
			
			<td>
			<?php 
			echo '<a href="'.base_url("index.php/user/delete/".$row["uid"]).'">Delete</a>';
			?>			</td>
			<?php 
				}
			
			?>
			</tr>
			
<?php 
	$i++;
		}
	}
?>

		<tr><td colspan="<?php if($tmpCI->session->userdata("usertype")== 4)
		{
			echo "7";
		}
		else 
		{
			echo "5";
		}
		?>">
			<div class="f-right" >
	      <span style="width:120px;">
	      <?php 
	      
	      	if (isset($start)&&$start>=10)
	      	{
				$prev =$start-10;
				echo '<a href="'.base_url("index.php/user/userlist/".$prev).'">prev page</a>';
	      	}
	      	else
	      	{
	      		echo "prev page";
	      	}
	      ?>
	      </span>
	      <span style="width:120px;"><?php if (isset($start))echo ""+($num == 0?0:(intval($start)/10+1))."/".($num%10==0?$num/10:intval($num/10)+1);?>
	      </span>
	      <span style="width:120px;">
	        <?php 
	      	if (isset($start)&&$start+10<=$num)
	      	{
				$next =$start+10;
				echo '<a href="'.base_url("index.php/user/userlist/".$next).'">next page</a>';
	      	}
	      	else
	      	{
	      		echo "next page";
	      	}
	      ?>
	      </span>	      </div>
		</td></tr>
      </table>
      
 </div>
      